<template>
	<view class="body">
		<myHeader :title="title"></myHeader>
		<view class="mt-5">
			<uni-search-bar @confirm="sreachIt()" :focus="false" v-model="name" @clear="search=''"></uni-search-bar>
			<view>
				<uni-fab :pattern="btnPattern" @fabClick="pageTo('./add')"></uni-fab>
			</view>
			<!-- 计划列表 -->
			<uni-list v-for="(item,index) in list" :key="item.id">
				<uni-list-item :title="item.content" link="navigateTo" :note="'来自：'+item.createUserName+' - '+item.createTime">
				</uni-list-item>
			</uni-list>
		</view>
	</view>
</template>

<script>
	import myHeader from '../components/head.vue'
	import NetWorkTool from '@/api/netWorkTool'
	export default {
		data() {
			return {
				title: '意见建议',
				btnPattern: {
					buttonColor: '#e20909'
				},
				taskList: [{
					id: '1',
					title: '任务1',
					status: '待组长分配'

				}],
				// 列表请求参数
				current: 1,
				pageSize: 10,
				name: '',
				list: [],
			}
		},
		mounted() {
			// 请求列表
			this.getList();
		},
		methods: {
			// 请求列表
			getList() {
				NetWorkTool.POST('/api/feedback/query', {}, true).then(res => {
					this.list = res;
				})
			},
			//下拉刷新
			onPullDownRefresh() {
				uni.stopPullDownRefresh();
			},
			pageTo(val, data) {
				if (undefined != data) {
					uni.navigateTo({
						url: val + "?data=" + JSON.stringify(data)
					})
				} else {
					uni.navigateTo({
						url: val
					})
				}
			},
			sreachIt() {
				this.getList();
			}
		},
		components: {
			myHeader
		},
	}
</script>

<style>
	@import url("/static/party_building/assets/style/federation.css");
</style>
